<%@ page import="java.sql.*,pc.util.Utils"%>
<%
    Users user = Trader.getUser(request.getParameter("uid"));
	wstrader.task.home.futures.DailyBasis task = user.home.daily_basis.futures_daily_basis;
	wstrader.task.home.DailyBasisFutures task1 = user.home.daily_basis_fut;
	if (!user.Authenticated()) {
		response.sendRedirect("logon.jsp");
		return;
	}
	((Tasks)task1.getOwner()).clearFocus();
	task1.setFocus(true);	
	
%>

<%@include file="../header.jsp"%>

<%
//----------------------------------------------------------------------
		String newrec = request.getParameter("new_rec");
		String TrnDt = "";
		int id_arb1 = 0;
		int id_exrt = 0;
		double Rate = 0;
		String ter_mth_arb1 ="";
		double close_arb1=0;
		double low_arb1=0;
		double high_arb1=0;
		double bp_arb1=0;
		
		int id_arb2 = 0;
		String ter_mth_arb2 ="";
		double close_arb2=0;
		double low_arb2=0;
		double high_arb2=0;
		double bp_arb2=0;
		
		int id_arb3 = 0;
		String ter_mth_arb3 ="";
		double close_arb3=0;
		double low_arb3=0;
		double high_arb3=0;
		double bp_arb3=0;
		
		int id_arb4 = 0;
		String ter_mth_arb4 ="";
		double close_arb4=0;
		double low_arb4=0;
		double high_arb4=0;
		double bp_arb4=0;
		
		int id_arb5 = 0;
		String ter_mth_arb5 ="";
		double close_arb5=0;
		double low_arb5=0;
		double high_arb5=0;
		double bp_arb5=0;
		
		
		int id_rbs1 = 0;
		String ter_mth_rbs1 ="";
		double close_rbs1=0;
		double low_rbs1=0;
		double high_rbs1=0;
		double bp_rbs1=0;
		
		int id_rbs2 = 0;
		String ter_mth_rbs2 ="";
		double close_rbs2=0;
		double low_rbs2=0;
		double high_rbs2=0;
		double bp_rbs2=0;
		
		int id_rbs3 = 0;
		String ter_mth_rbs3 ="";
		double close_rbs3=0;
		double low_rbs3=0;
		double high_rbs3=0;
		double bp_rbs3=0;
		
		int id_rbs4 = 0;
		String ter_mth_rbs4 ="";
		double close_rbs4=0;
		double low_rbs4=0;
		double high_rbs4=0;
		double bp_rbs4=0;
		
		int id_rbs5 = 0;
		String ter_mth_rbs5 ="";
		double close_rbs5=0;
		double low_rbs5=0;
		double high_rbs5=0;
		double bp_rbs5=0;
		
		int id_rbs6 = 0;
		String ter_mth_rbs6 ="";
		double close_rbs6=0;
		double low_rbs6=0;
		double high_rbs6=0;
		double bp_rbs6=0;	
//----------------------------------------------------------------------

	java.sql.Date focused_id = task.doTask();
	int Chk = Utils.getDateYear(focused_id);

	ResultSet rs_fdb;
	ResultSet rs_exrt;
	if (Chk>1970) 
	{
		rs_exrt = task.fetchExchangeRateRecord();
		rs_exrt.beforeFirst();
		if (rs_exrt.next()==true)
		{
			id_exrt = rs_exrt.getInt("id");
			Rate = rs_exrt.getDouble("usd_to_vnd");
		}
		rs_exrt.close();
		
		rs_fdb   =task.fetchFuturesDailyBasisRecord();
		rs_fdb.beforeFirst();
		if (rs_fdb.next()==true)
		{
		TrnDt = Utils.dateToStr(rs_fdb.getDate("daily_basis_date"));
	
		id_rbs1 = rs_fdb.getInt("id");
		ter_mth_rbs1 =Utils.dateToStr(rs_fdb.getDate("terminal_month")).substring(3);
		close_rbs1=rs_fdb.getDouble("closing_price");
		low_rbs1=rs_fdb.getDouble("low_price");
		high_rbs1=rs_fdb.getDouble("high_price");
		bp_rbs1=rs_fdb.getDouble("basis_price");
		rs_fdb.next();
		id_rbs2 = rs_fdb.getInt("id");
		ter_mth_rbs2 =Utils.dateToStr(rs_fdb.getDate("terminal_month")).substring(3);
		close_rbs2=rs_fdb.getDouble("closing_price");
		low_rbs2=rs_fdb.getDouble("low_price");
		high_rbs2=rs_fdb.getDouble("high_price");
		bp_rbs2=rs_fdb.getDouble("basis_price");
		rs_fdb.next();
		id_rbs3 = rs_fdb.getInt("id");
		ter_mth_rbs3 =Utils.dateToStr(rs_fdb.getDate("terminal_month")).substring(3);
		close_rbs3=rs_fdb.getDouble("closing_price");
		low_rbs3=rs_fdb.getDouble("low_price");
		high_rbs3=rs_fdb.getDouble("high_price");
		bp_rbs3=rs_fdb.getDouble("basis_price");
		rs_fdb.next();
		id_rbs4 = rs_fdb.getInt("id");
		ter_mth_rbs4 =Utils.dateToStr(rs_fdb.getDate("terminal_month")).substring(3);
		close_rbs4=rs_fdb.getDouble("closing_price");
		low_rbs4=rs_fdb.getDouble("low_price");
		high_rbs4=rs_fdb.getDouble("high_price");
		bp_rbs4=rs_fdb.getDouble("basis_price");
		rs_fdb.next();
		id_rbs5 = rs_fdb.getInt("id");
		ter_mth_rbs5 =Utils.dateToStr(rs_fdb.getDate("terminal_month")).substring(3);
		close_rbs5=rs_fdb.getDouble("closing_price");
	    low_rbs5=rs_fdb.getDouble("low_price");
		high_rbs5=rs_fdb.getDouble("high_price");
		bp_rbs5=rs_fdb.getDouble("basis_price");
		rs_fdb.next();
		id_rbs6 = rs_fdb.getInt("id");
		ter_mth_rbs6 =Utils.dateToStr(rs_fdb.getDate("terminal_month")).substring(3);
	    close_rbs6=rs_fdb.getDouble("closing_price");
		low_rbs6=rs_fdb.getDouble("low_price");
	    high_rbs6=rs_fdb.getDouble("high_price");
		bp_rbs6=rs_fdb.getDouble("basis_price");
		rs_fdb.next();	
		
		id_arb1 = rs_fdb.getInt("id");
		ter_mth_arb1 =Utils.dateToStr(rs_fdb.getDate("terminal_month")).substring(3);
		close_arb1=rs_fdb.getDouble("closing_price");
		low_arb1=rs_fdb.getDouble("low_price");
		high_arb1=rs_fdb.getDouble("high_price");
		bp_arb1=rs_fdb.getDouble("basis_price");
		rs_fdb.next();
		id_arb2 = rs_fdb.getInt("id");
		ter_mth_arb2 =Utils.dateToStr(rs_fdb.getDate("terminal_month")).substring(3);
		close_arb2=rs_fdb.getDouble("closing_price");
		low_arb2=rs_fdb.getDouble("low_price");
		high_arb2=rs_fdb.getDouble("high_price");
		bp_arb2=rs_fdb.getDouble("basis_price");
		rs_fdb.next();
		id_arb3 = rs_fdb.getInt("id");
		ter_mth_arb3 =Utils.dateToStr(rs_fdb.getDate("terminal_month")).substring(3);
		close_arb3=rs_fdb.getDouble("closing_price");
		low_arb3=rs_fdb.getDouble("low_price");
		high_arb3=rs_fdb.getDouble("high_price");
		bp_arb3=rs_fdb.getDouble("basis_price");
		rs_fdb.next();
		id_arb4 = rs_fdb.getInt("id");
		ter_mth_arb4 =Utils.dateToStr(rs_fdb.getDate("terminal_month")).substring(3);
		close_arb4=rs_fdb.getDouble("closing_price");
		low_arb4=rs_fdb.getDouble("low_price");
		high_arb4=rs_fdb.getDouble("high_price");
		bp_arb4=rs_fdb.getDouble("basis_price");
		rs_fdb.next();
		id_arb5 = rs_fdb.getInt("id");
		ter_mth_arb5 =Utils.dateToStr(rs_fdb.getDate("terminal_month")).substring(3);
		close_arb5=rs_fdb.getDouble("closing_price");
		low_arb5=rs_fdb.getDouble("low_price");
		high_arb5=rs_fdb.getDouble("high_price");
		bp_arb5=rs_fdb.getDouble("basis_price");
	
		}
	}
	
	long new_id = task.getLastID("futures_daily_basis");
	ResultSet rs=null;
	ResultSet rsa = task.GetTerminalMthList("NYC");
	rsa.beforeFirst();
	rsa.next();
	ResultSet rsr = task.GetTerminalMthList("LIFFE");
	rsr.beforeFirst();
	rsr.next();	
%>

<link href="style.css" rel="stylesheet" type="text/css">
<script language="javascript">
function updList()
{
	var form = document.formMain;
	var value = form.daily_basis_date.value; 
	alert(value);
	if (addNewListItemById("db_date",value) < 0) return;
}

function doAddNew()
{
	var form = document.formMain;
	form.rec_id.value=1;
	form.id_arb1.value = "<%=new_id+1%>";
	form.ter_mth_arb1.value ="<%=Utils.dateToStr(rsa.getDate("month")).substring(3)%>";
	form.close_arb1.value=0;
	form.low_arb1.value=0;
	form.high_arb1.value=0;
	form.bp_arb1.value=0;
	"<%rsa.next();%>";
	form.id_arb2.value = "<%=new_id+2%>";
	form.ter_mth_arb2.value ="<%=Utils.dateToStr(rsa.getDate("month")).substring(3)%>";
	form.close_arb2.value=0;
	form.low_arb2.value=0;
	form.high_arb2.value=0;
	form.bp_arb2.value=0;	
	"<%rsa.next();%>";
	form.id_arb3.value = "<%=new_id+3%>";
	form.ter_mth_arb3.value ="<%=Utils.dateToStr(rsa.getDate("month")).substring(3)%>";
	form.close_arb3.value=0;
	form.low_arb3.value=0;
	form.high_arb3.value=0;
	form.bp_arb3.value=0;	
	"<%rsa.next();%>";
	form.id_arb4.value = "<%=new_id+4%>";
	form.ter_mth_arb4.value ="<%=Utils.dateToStr(rsa.getDate("month")).substring(3)%>";
	form.close_arb4.value=0;
	form.low_arb4.value=0;
	form.high_arb4.value=0;
	form.bp_arb4.value=0;	
	"<%rsa.next();%>";
	form.id_arb5.value = "<%=new_id+5%>";
	form.ter_mth_arb5.value ="<%=Utils.dateToStr(rsa.getDate("month")).substring(3)%>";
	form.close_arb5.value=0;
	form.low_arb5.value=0;
	form.high_arb5.value=0;
	form.bp_arb5.value=0;	
	
	form.id_rbs1.value = "<%=new_id+6%>";
	form.ter_mth_rbs1.value ="<%=Utils.dateToStr(rsr.getDate("month")).substring(3)%>";
	form.close_rbs1.value=0;
	form.low_rbs1.value=0;
	form.high_rbs1.value=0;
	form.bp_rbs1.value=0;	
	"<%rsr.next();%>";
	form.id_rbs2.value = "<%=new_id+7%>";
	form.ter_mth_rbs2.value ="<%=Utils.dateToStr(rsr.getDate("month")).substring(3)%>";
	form.close_rbs2.value=0;
	form.low_rbs2.value=0;
	form.high_rbs2.value=0;
	form.bp_rbs2.value=0;		
	"<%rsr.next();%>";
	form.id_rbs3.value = "<%=new_id+8%>";
	form.ter_mth_rbs3.value ="<%=Utils.dateToStr(rsr.getDate("month")).substring(3)%>";
	form.close_rbs3.value=0;
	form.low_rbs3.value=0;
	form.high_rbs3.value=0;
	form.bp_rbs3.value=0;		
	"<%rsr.next();%>";
	form.id_rbs4.value = "<%=new_id+9%>";
	form.ter_mth_rbs4.value ="<%=Utils.dateToStr(rsr.getDate("month")).substring(3)%>";
	form.close_rbs4.value=0;
	form.low_rbs4.value=0;
	form.high_rbs4.value=0;
	form.bp_rbs4.value=0;		
	"<%rsr.next();%>";
	form.id_rbs5.value = "<%=new_id+10%>";
	form.ter_mth_rbs5.value ="<%=Utils.dateToStr(rsr.getDate("month")).substring(3)%>";
	form.close_rbs5.value=0;
	form.low_rbs5.value=0;
	form.high_rbs5.value=0;
	form.bp_rbs5.value=0;		
	"<%rsr.next();%>";
	form.id_rbs6.value = "<%=new_id+11%>";
	form.ter_mth_rbs6.value ="<%=Utils.dateToStr(rsr.getDate("month")).substring(3)%>";
	form.close_rbs6.value=0;
	form.low_rbs6.value=0;
	form.high_rbs6.value=0;
	form.bp_rbs6.value=0;		
	
}

function doUpdate()
{	
	var form = document.formMain;

	if (form.daily_basis_date.value =="") 
	{
		alert("Transaction Date Cannot Be Empty");
	}
	else
	{
		doTask(1);
	}
}

function chkLen(val)
{
	var form = document.formMain;
	var value = getValue(val);
	var len = value.length;
	if (len!=6)
	{
		//alert("Date format you have keyed in is wrong");
		var oldval = form.temp.value;
		setValue(val,oldval);
		form.temp.value="";
	}
}

function getTerMth(val)
{
	var form = document.formMain;
	var value = getValue(val);
	form.temp.value = value;
}

function doListView()
{
	var form = document.formMain;
	form.action = "home.jsp";
	form.submit();
}

function doBoxClick()
{
	var form = document.formMain;
	form.rec_id.value=2;
	doPost();
}
</script>

<style type="text/css">
<!--
.style3 {font-weight: bold}
.style9 {font-size: 10px}
-->
</style>
<form method="POST" name="formMain" action="" onSubmit="">				  
<table width="100%" border="0" class="style2">
	<tr>
	  <td valign="middle"><img src="images/futures-dailybasis.jpg" width="220" height="30"></td>
	</tr>
	<tr><td height="468" valign="top">
    <table width="100%" height="466" border="1" cellpadding="0" cellspacing="0" class="style2">
      <tr valign="top">
	  <td width="158" height="464"><table width="100%">
	  	<tr>
	  	  <td align="center" bgcolor="#EEEEEE" class="style1">Daily Basis </td>
	  	</tr>
	  	<tr><td height="412" valign="top">
	  <select name="futures_daily_basis" size="25" id="futures_daily_basis" onChange="doBoxClick()" style="width:150px;border:0">
		<%@include file="include/FuturesDailyBasisDateList-card.jsp"%>
      </select>
	  	</td></tr>
		<tr><td height="23" align="left" valign="bottom"><img src="images/new.gif" width="15" height="15" onClick="doAddNew()">&nbsp;<img src="images/delete.gif" width="15" height="15"></td>
		</tr>
	  </table></td>
        <td width="1058" align="center"><table width="100%"><tr><td align="left" valign="top">
          <table width="100%" height="434" border="0" class="style2">
        <tr>
          <td width="163" align="right"><input name="temp" type="hidden" id="temp">
            Daily Basis Date</td>
          <td width="12">&nbsp;</td>
          <td width="183" class="style1"><span class="style3">
            <input name="daily_basis_date" type="text" id="daily_basis_date"  onChange="updList()" value="<%=TrnDt%>" readonly="true">
             </span></td>
	      
          <td width="55" class="style1"><span class="style3"><img src="js/calendar.gif" width="20" height="20" align="absmiddle" onClick="popUpCalendar(this,'daily_basis_date','dd-mmm-yy');"></span></td>
          <td width="22">&nbsp;</td>
          <td width="180" align="right">Exchange Rate (Usd To VND) </td>
          <td width="14">&nbsp;</td>
          <td width="163"><span class="style3"><input name="rate" type="text" id="rate" value="<%=Rate%>">
            <input name="ex_rt_id" type="hidden" id="ex_rt_id" value="<%=id_exrt%>">
          </span></td>
          <td width="12">&nbsp;</td>
          </tr>
        <tr>
          <td align="right" class="style1">Terminal Market </td>
          <td>&nbsp;</td>
          <td colspan="2"><span class="style3"><span class="style1">
NEW YORK </span></span></td>
          <td>&nbsp;</td>
          <td align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td><span class="style3"><span class="style1">
          </span></span> </td>
          <td>&nbsp;</td>
          </tr>
        <tr>
          <td colspan="8" align="center" class="style2"><table width="60%"  border="0" cellspacing="0" cellpadding="0">
            <tr align="center" bgcolor="#DDDDDD">
              <td width="10%" class="style1">ID</td>
              <td width="2%">&nbsp;</td>
              <td width="15%" class="style1">TER.MTH</td>
              <td width="2%">&nbsp;</td>
              <td width="15%" class="style1">CLOSE</td>
              <td width="2%">&nbsp;</td>
              <td width="13%" class="style1">LOW</td>
              <td width="2%">&nbsp;</td>
              <td width="15%" class="style1">HIGH</td>
              <td width="2%" class="style1">&nbsp;</td>
              <td width="22%" class="style1">BASIS PRICE </td>
              </tr>
            <tr>
              <td><input name="id_arb1" type="text" class="textnoedit"  id="id_arb1" style="width:50px" value="<%=id_arb1%>" readonly="true"></td>
              <td>&nbsp;</td>
              <td><input name="ter_mth_arb1" type="text" id="ter_mth_arb1" onChange="chkLen('ter_mth_arb1');" onFocus="getTerMth('ter_mth_arb1');" style="width:75px" value="<%=ter_mth_arb1%>"></td>
              <td>&nbsp;</td>
              <td><input name="close_arb1" type="text" id="close_arb1" style="width:75px" value="<%=close_arb1%>"></td>
              <td>&nbsp;</td>
              <td><input name="low_arb1" type="text" id="low_arb1" style="width:75px" value="<%=low_arb1%>"></td>
              <td>&nbsp;</td>
              <td><input name="high_arb1" type="text" id="high_arb1" style="width:75px" value="<%=high_arb1%>"></td>
              <td>&nbsp;</td>
              <td><input name="bp_arb1" type="text" id="bp_arb1" style="width:110px" value="<%=bp_arb1%>"></td>
              </tr>
            <tr>
              <td><input name="id_arb2" type="text" class="textnoedit"  id="id_arb2" style="width:50px" value="<%=id_arb2%>" readonly="true"></td>
              <td>&nbsp;</td>
              <td><input name="ter_mth_arb2" type="text" id="ter_mth_ar2" style="width:75px" onChange="chkLen('ter_mth_arb2');" onFocus="getTerMth('ter_mth_arb2');" value="<%=ter_mth_arb2%>"></td>
              <td>&nbsp;</td>
              <td><input name="close_arb2" type="text" id="close_arb2" style="width:75px" value="<%=close_arb2%>"></td>
              <td>&nbsp;</td>
              <td><input name="low_arb2" type="text" id="low_arb2" style="width:75px" value="<%=low_arb2%>"></td>
              <td>&nbsp;</td>
              <td><input name="high_arb2" type="text" id="high_arb2" style="width:75px" value="<%=high_arb2%>"></td>
              <td>&nbsp;</td>
              <td><input name="bp_arb2" type="text" id="bp_arb2" style="width:110px" value="<%=bp_arb2%>"></td>
              </tr>
            <tr>
              <td><input name="id_arb3" type="text" class="textnoedit"  id="id_arb3" style="width:50px" value="<%=id_arb3%>" readonly="true"></td>
              <td>&nbsp;</td>
              <td><input name="ter_mth_arb3" type="text" id="ter_mth_arb3" style="width:75px" onChange="chkLen('ter_mth_arb3');" onFocus="getTerMth('ter_mth_arb3');" value="<%=ter_mth_arb3%>"></td>
              <td>&nbsp;</td>
              <td><input name="close_arb3" type="text" id="close_arb3" style="width:75px" value="<%=close_arb3%>"></td>
              <td>&nbsp;</td>
              <td><input name="low_arb3" type="text" id="low_arb3" style="width:75px" value="<%=low_arb3%>"></td>
              <td>&nbsp;</td>
              <td><input name="high_arb3" type="text" id="high_arb3" style="width:75px" value="<%=high_arb3%>"></td>
              <td>&nbsp;</td>
              <td><input name="bp_arb3" type="text" id="bp_arb3" style="width:110px" value="<%=bp_arb3%>"></td>
              </tr>
            <tr>
              <td><input name="id_arb4" type="text" class="textnoedit"  id="id_arb4" style="width:50px" value="<%=id_arb4%>" readonly="true"></td>
              <td>&nbsp;</td>
              <td><input name="ter_mth_arb4" type="text" id="ter_mth_arb4" style="width:75px" onChange="chkLen('ter_mth_arb4');" onFocus="getTerMth('ter_mth_arb4');" value="<%=ter_mth_arb4%>"></td>
              <td>&nbsp;</td>
              <td><input name="close_arb4" type="text" id="close_arb4" style="width:75px" value="<%=close_arb4%>"></td>
              <td>&nbsp;</td>
              <td><input name="low_arb4" type="text" id="low_arb4" style="width:75px" value="<%=low_arb4%>"></td>
              <td>&nbsp;</td>
              <td><input name="high_arb4" type="text" id="high_arb4" style="width:75px" value="<%=high_arb4%>"></td>
              <td>&nbsp;</td>
              <td><input name="bp_arb4" type="text" id="bp_arb4" style="width:110px" value="<%=bp_arb4%>"></td>
              </tr>
            <tr>
              <td><input name="id_arb5" type="text" class="textnoedit"  id="id_arb5" style="width:50px" value="<%=id_arb5%>" readonly="true"></td>
              <td>&nbsp;</td>
              <td><input name="ter_mth_arb5" type="text" id="ter_mth_arb5" style="width:75px" onChange="chkLen('ter_mth_arb5');" onFocus="getTerMth('ter_mth_arb5');" value="<%=ter_mth_arb5%>"></td>
              <td>&nbsp;</td>
              <td><input name="close_arb5" type="text" id="close_arb5" style="width:75px" value="<%=close_arb5%>"></td>
              <td>&nbsp;</td>
              <td><input name="low_arb5" type="text" id="low_arb5" style="width:75px" value="<%=low_arb5%>"></td>
              <td>&nbsp;</td>
              <td><input name="high_arb5" type="text" id="high_arb5" style="width:75px" value="<%=high_arb5%>"></td>
              <td>&nbsp;</td>
              <td><input name="bp_arb5" type="text" id="bp_arb5" style="width:110px" value="<%=bp_arb5%>"></td>
              </tr>
            <tr>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              </tr>
          </table></td>
          <td class="style3">&nbsp;</td>
		  </tr>
        <tr>
          <td align="right" class="style2">&nbsp;</td>
          <td class="style3">&nbsp;</td>
          <td colspan="2" class="style3">&nbsp;</td>
          <td class="style3">&nbsp;</td>
          <td align="right" class="style2">&nbsp;</td>
          <td class="style3">&nbsp;</td>
          <td class="style3">&nbsp;</td>
          <td class="style3">&nbsp;</td>
        </tr>
        <tr>
          <td align="right" class="style1">Terminal Market </td>
          <td class="style3">&nbsp;</td>
          <td colspan="2" class="style3"><span class="style1">LIFFE
</span></td>
          <td class="style3">&nbsp;</td>
          <td align="right" class="style2">&nbsp;</td>
          <td class="style3">&nbsp;</td>
          <td class="style3">&nbsp;</td>
          <td class="style3">&nbsp;</td>
          </tr>
        <tr>
          <td colspan="8" align="center" class="style2"><table width="60%"  border="0" cellspacing="0" cellpadding="0">
            <tr align="center" bgcolor="#DDDDDD">
              <td width="10%" class="style1">ID</td>
              <td width="2%">&nbsp;</td>
              <td width="15%" class="style1">TER.MTH</td>
              <td width="2%">&nbsp;</td>
              <td width="15%" class="style1">CLOSE</td>
              <td width="2%">&nbsp;</td>
              <td width="13%" class="style1">LOW</td>
              <td width="2%">&nbsp;</td>
              <td width="15%" class="style1">HIGH</td>
              <td width="2%" class="style1">&nbsp;</td>
              <td width="22%" class="style1">BASIS PRICE </td>
              </tr>
            <tr>
              <td><input name="id_rbs1" type="text" class="textnoedit"  id="id_rbs1" style="width:50px" value="<%=id_rbs1%>" readonly="true"></td>
              <td>&nbsp;</td>
              <td><input name="ter_mth_rbs1" type="text" id="ter_mth_rbs1" style="width:75px" onChange="chkLen('ter_mth_rbs1');" onFocus="getTerMth('ter_mth_rbs1');" value="<%=ter_mth_rbs1%>"></td>
              <td>&nbsp;</td>
              <td><input name="close_rbs1" type="text" id="close_rbs1" style="width:75px" value="<%=close_rbs1%>"></td>
              <td>&nbsp;</td>
              <td><input name="low_rbs1" type="text" id="low_rbs1" style="width:75px" value="<%=low_rbs1%>"></td>
              <td>&nbsp;</td>
              <td><input name="high_rbs1" type="text" id="high_rbs1" style="width:75px" value="<%=high_rbs1%>"></td>
              <td>&nbsp;</td>
              <td><input name="bp_rbs1" type="text" id="bp_rbs1" style="width:110px" value="<%=bp_rbs1%>"></td>
              </tr>
            <tr>
              <td><input name="id_rbs2" type="text" class="textnoedit"  id="id_rbs2" style="width:50px" value="<%=id_rbs2%>" readonly="true"></td>
              <td>&nbsp;</td>
              <td><input name="ter_mth_rbs2" type="text" id="ter_mth_ar2" style="width:75px" onChange="chkLen('ter_mth_rbs2');" onFocus="getTerMth('ter_mth_rbs2');" value="<%=ter_mth_rbs2%>"></td>
              <td>&nbsp;</td>
              <td><input name="close_rbs2" type="text" id="close_rbs2" style="width:75px" value="<%=close_rbs2%>"></td>
              <td>&nbsp;</td>
              <td><input name="low_rbs2" type="text" id="low_rbs2" style="width:75px" value="<%=low_rbs2%>"></td>
              <td>&nbsp;</td>
              <td><input name="high_rbs2" type="text" id="high_rbs2" style="width:75px" value="<%=high_rbs2%>"></td>
              <td>&nbsp;</td>
              <td><input name="bp_rbs2" type="text" id="bp_rbs2" style="width:110px" value="<%=bp_rbs2%>"></td>
              </tr>
            <tr>
              <td><input name="id_rbs3" type="text" class="textnoedit"  id="id_rbs3" style="width:50px" value="<%=id_rbs3%>" readonly="true"></td>
              <td>&nbsp;</td>
              <td><input name="ter_mth_rbs3" type="text" id="ter_mth_rbs3" style="width:75px" onChange="chkLen('ter_mth_rbs3');" onFocus="getTerMth('ter_mth_rbs3');" value="<%=ter_mth_rbs3%>"></td>
              <td>&nbsp;</td>
              <td><input name="close_rbs3" type="text" id="close_rbs3" style="width:75px" value="<%=close_rbs3%>"></td>
              <td>&nbsp;</td>
              <td><input name="low_rbs3" type="text" id="low_rbs3" style="width:75px" value="<%=low_rbs3%>"></td>
              <td>&nbsp;</td>
              <td><input name="high_rbs3" type="text" id="high_rbs3" style="width:75px" value="<%=high_rbs3%>"></td>
              <td>&nbsp;</td>
              <td><input name="bp_rbs3" type="text" id="bp_rbs3" style="width:110px" value="<%=bp_rbs3%>"></td>
              </tr>
            <tr>
              <td><input name="id_rbs4" type="text" class="textnoedit"  id="id_rbs4" style="width:50px" value="<%=id_rbs4%>" readonly="true"></td>
              <td>&nbsp;</td>
              <td><input name="ter_mth_rbs4" type="text" id="ter_mth_rbs4" style="width:75px" onChange="chkLen('ter_mth_rbs4');" onFocus="getTerMth('ter_mth_rbs4');" value="<%=ter_mth_rbs4%>"></td>
              <td>&nbsp;</td>
              <td><input name="close_rbs4" type="text" id="close_rbs4" style="width:75px" value="<%=close_rbs4%>"></td>
              <td>&nbsp;</td>
              <td><input name="low_rbs4" type="text" id="low_rbs4" style="width:75px" value="<%=low_rbs4%>"></td>
              <td>&nbsp;</td>
              <td><input name="high_rbs4" type="text" id="high_rbs4" style="width:75px" value="<%=high_rbs4%>"></td>
              <td>&nbsp;</td>
              <td><input name="bp_rbs4" type="text" id="bp_rbs4" style="width:110px" value="<%=bp_rbs4%>"></td>
              </tr>
            <tr>
              <td><input name="id_rbs5" type="text" class="textnoedit"  id="id_rbs5" style="width:50px" value="<%=id_rbs5%>" readonly="true"></td>
              <td>&nbsp;</td>
              <td><input name="ter_mth_rbs5" type="text" id="ter_mth_rbs5" style="width:75px" onChange="chkLen('ter_mth_rbs5');" onFocus="getTerMth('ter_mth_rbs5');" value="<%=ter_mth_rbs5%>"></td>
              <td>&nbsp;</td>
              <td><input name="close_rbs5" type="text" id="close_rbs5" style="width:75px" value="<%=close_rbs5%>"></td>
              <td>&nbsp;</td>
              <td><input name="low_rbs5" type="text" id="low_rbs5" style="width:75px" value="<%=low_rbs5%>"></td>
              <td>&nbsp;</td>
              <td><input name="high_rbs5" type="text" id="high_rbs5" style="width:75px" value="<%=high_rbs5%>"></td>
              <td>&nbsp;</td>
              <td><input name="bp_rbs5" type="text" id="bp_rbs5" style="width:110px" value="<%=bp_rbs5%>"></td>
              </tr>
            <tr>
              <td><input name="id_rbs6" type="text" class="textnoedit"  id="id_rbs6" style="width:50px" value="<%=id_rbs6%>" readonly="true"></td>
              <td>&nbsp;</td>
              <td><input name="ter_mth_rbs6" type="text" id="ter_mth_rbs6" style="width:75px" onChange="chkLen('ter_mth_rbs6');" onFocus="getTerMth('ter_mth_rbs6');" value="<%=ter_mth_rbs6%>"></td>
              <td>&nbsp;</td>
              <td><input name="close_rbs6" type="text" id="close_rbs6" style="width:75px" value="<%=close_rbs6%>"></td>
              <td>&nbsp;</td>
              <td><input name="low_rbs6" type="text" id="low_rbs6" style="width:75px" value="<%=low_rbs6%>"></td>
              <td>&nbsp;</td>
              <td><input name="high_rbs6" type="text" id="high_rbs6" style="width:75px" value="<%=high_rbs6%>"></td>
              <td>&nbsp;</td>
              <td><input name="bp_rbs6" type="text" id="bp_rbs6" style="width:110px" value="<%=bp_rbs6%>"></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              </tr>
          </table></td>          <td class="style3">&nbsp;</td>
		  </tr>
        <tr>
          <td align="right" class="style2">&nbsp;</td>
          <td class="style3">&nbsp;</td>
          <td colspan="2" class="style3">&nbsp;</td>
          <td class="style3">&nbsp;</td>
          <td align="center" class="style3">&nbsp;</td>
          <td class="style3">&nbsp;</td>
          <td class="style3">&nbsp;</td>
		  <td class="style3">&nbsp;</td>
		  </tr>
        <tr>
          <td height="26" align="right" class="style2">&nbsp;</td>
          <td class="style3">&nbsp;</td>
          <td colspan="2" class="style3">&nbsp;</td>
          <td class="style3">&nbsp;</td>
          <td align="right" class="style2">&nbsp;</td>
          <td class="style3">&nbsp;</td>
          <td class="style3">&nbsp;</td>
          <td class="style3">&nbsp;</td>
		  </tr>
        <tr>
          <td height="26" align="right" class="style2">&nbsp;</td>
          <td class="style3">&nbsp;</td>
          	<td colspan="2" class="style3">&nbsp;</td>
          	<td class="style3">&nbsp;</td>
          <td align="right" class="style3">&nbsp;</td>
          <td class="style3">&nbsp;</td>
          <td class="style3">&nbsp;</td>
    	  <td class="style3">&nbsp;</td>
    	  </tr>
</table>
</td></tr>
<tr>
	<td class="style3"><table width="100%">
		<tr>
			<td valign="middle"><img src="images/update.gif" width="15" height="15" onClick="doUpdate()"></td>
			<td align="right"><img src="images/report.jpg" width="55" height="18">&nbsp;<img src="images/listview.jpg" width="55" height="18" onClick="doListView()"></td>
		</tr>
	</table></td>
</tr>
</table>
		
		</td>
      </tr>
  </table>
</td></tr>
</table>  
	<span class="style3"><input type="hidden" name="uid"        id="uid"       value="<%=user.getuid()%>">		
    <input type="hidden" name="task_id"    id = "task_id"   value="0">
    <input name="rec_id" type="hidden" id="rec_id" value="0">
    <input name="new_rec" type="hidden" id="new_rec" value="0">
  </span>

    <% 
	if (newrec.compareTo("1")==0)
	{ 
%>	  
<script>
	doAddNew();
</script>
<%
	}
%>  
  
</form>  
<span class="style3">
<%@include file="../footer.jsp"%>

</span>